package com.cn.demo.controller;

import com.cn.demo.entity.Organization;
import com.cn.demo.service.OrganizationService;
import com.cn.demo.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/organization")
public class OrganizationController {
    @Autowired
    private OrganizationService organizationService;


    @PostMapping(value = "/add")
    public Result add(@RequestBody Organization organization){
        return  organizationService.add(organization);
    }

    @GetMapping(value = "/get")
    public Result get(@RequestParam(value = "page",defaultValue = "1")Integer page, @RequestParam(value = "limit",defaultValue = "5")Integer limit){
        Organization organization = new Organization();
        return organizationService.get(organization,page,limit);
    }


}